/*
 * link.h
 *
 *  Created on: 2023年8月24日
 *      Author: HXF
 */

#ifndef DS_UTIL_INS_LINK_H_
#define DS_UTIL_INS_LINK_H_

typedef struct link{
    int len;
    void *data;
    struct link* next;
}link_t;

link_t *link_creathead(void);
link_t *link_creatnode(void *data, int len);
int link_push_head(link_t *head, void *data, int len);
int link_push_end(link_t *head, void *data, int len);
int link_pop(link_t *head, void *data, int *len);
int link_len(link_t *head);
int link_find_by_idx(link_t *head, void *data, int *ptr_len, int idx);
#if(0)
int link_find_by_pageid(link_t *head, void *data, int data_len, unsigned char *pageid);
#endif
int link_delte_all_node(link_t *head);

#endif /* DS_UTIL_INS_LINK_H_ */
